package com.travel.modules.asset.controller;

import com.travel.commons.utils.R;
import com.travel.modules.sys.service.SysUserService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/static")
public class InfoController {
    @Resource
    private SysUserService sysUserService;

    /**
     * 根据loginName获取用户的基本信息
     * @param loginName 登录名
     * @return 用户详情信息
     */
    @RequestMapping("/user/info/{loginName}")
    public R infoByLoginName(@PathVariable("loginName") String loginName) {
        return R.ok().put("page", sysUserService.getUserInfoByLoginName(loginName));
    }
}
